<?php
class clsCombo {
	public function gerarValores($sql, $id, $descricao, $tipo = 0) {
		$rs = connectorFactory::query ( $sql );
		foreach ( $rs as $valores ) {
			switch ($tipo) {
				case 1 :
					$desc = utf8_encode ( $valores [$descricao] );
					break;
				case 2 :
					$desc = utf8_decode ( $valores [$descricao] );
					break;
				default :
					$desc = $valores [$descricao];
			}
			$variavel [$valores [$id]] = $desc;
		}
		return $variavel;
	}
}

?>